package com.itheima.tanhua.apiImpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.tanhua.api.db.QuestionApi;
import com.itheima.tanhua.mapper.QuestionMapper;
import com.itheima.tanhua.pojo.db.Question;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class QuestionApiImpl implements QuestionApi {

    @Autowired
    private QuestionMapper questionMapper;

    @Override
    public Question findByUserId(Long userId) {
        LambdaQueryWrapper<Question> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(Question::getUserId,userId);
        return  questionMapper.selectOne(wrapper);
    }
}
